<template>
  <div>
    <el-main>
      <el-form :model="formParams" ref="queryForm" :inline="true" label-width="88px" style="width:100%">
        <el-row>
          <el-col :span="12">
            <el-form-item label="表码" prop="ipaddr">
              <span class="text-size">{{mabiao}}</span>
            </el-form-item>

          </el-col>
          <el-col :span="12">

            <el-form-item label="编号" prop="ipaddr">
              <span class="text-size">{{ formParams.number }}</span>
            </el-form-item>

          </el-col>
        </el-row>
        <el-row>
          <el-col :span="20">
            <el-form-item label="委托单位" prop="ipaddr">
              <span class="text-size">{{ formParams.enterpriseName }}</span>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="委托人" prop="ipaddr">
              <span class="text-size">{{ formParams.userName }}</span>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="联系电话" prop="ipaddr">
              <span class="text-size">{{ formParams.mobile }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="工程名称" prop="ipaddr" style="display: inline-block;">
              <div class="text-size" style="width:500px;">{{ formParams.engineeringName }}</div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="20">
            <el-form-item label="工程地点" prop="ipaddr">
              <span class="text-size">{{ formParams.address }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="20">
            <el-form-item label="建设单位" prop="ipaddr">
              <span class="text-size">{{ formParams.constructionUnit }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="20">
            <el-form-item label="监理单位" prop="ipaddr">
              <span class="text-size">{{ formParams.supervisionUnit }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="20">
            <el-form-item label="设计单位" prop="ipaddr">
              <span class="text-size">{{ formParams.designUnit }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="20">
            <el-form-item label="施工单位" prop="ipaddr">
              <span class="text-size">{{ formParams.surveyUnit }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="20">
            <el-form-item label="施工单位" prop="ipaddr">
              <span class="text-size">{{ formParams.construcUnit }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="工程概况" prop="ipaddr" style="display: inline-block;">
              <div class="text-size" style="width: 500px;">{{ formParams.overview }}</div>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="20">
            <el-form-item label="检测内容:" prop="ipaddr">
              <span class="text-size">{{ formParams.detectionContent }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="20">
            <el-form-item label="检测依据:" prop="ipaddr">
              <span class="text-size">{{ formParams.accordingContent }}</span>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="委托日期:" prop="ipaddr">
              <span class="text-size">{{ formParams.commissionDate }}</span>
            </el-form-item>

          </el-col>
          <!-- <el-col :span="12">
            <span class="text-size">附表:</span>
            <span class="text-size" style="color:#1176FF;padding:0 10px">2</span>
            <span class="text-size" style="color:#1176FF;cursor: pointer;" @click="onCheck">查看附表</span>
          </el-col> -->
        </el-row>
        <el-row class="margin-bottom-10">
          <el-col :span="24">
             <el-form-item label="业务类型" prop="ipaddr">
              <span v-if="formParams.businessType" class="text-size"> <span v-if="formParams.businessType=='shinei'" >室内检测</span>  <span v-if="formParams.businessType=='shiwai'" >现场检测</span>  </span>
              <el-select v-else v-model="formParams.businessType" placeholder="请选择">
                <el-option key="shiwai" label="室外检测" value="shiwai"></el-option>
                <el-option key="shinei" label="室内检测" value="shinei"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row class="margin-bottom-10">

          <el-col :span="24">
            <el-form-item label="项目经理" prop="ipaddr">
              <el-select v-model="formParams.businessManagerId" placeholder="请选择">
                <el-option v-for="item in projectOptions" :key="item.userId" :label="item.nickName"
                  :value="item.userId"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row class="margin-bottom-10">
          <el-col style="text-align: center;">
            <el-button type="primary" @click="onShouLi">受理</el-button>
            <el-button @click="close">关闭</el-button>
          </el-col>
        </el-row>
      </el-form>

    </el-main>
  </div>
</template>

<script>
import {
  acceptanceOrder, getSystemset
} from "@/api/enterprise/enterprise";
import {
  updatedtallList,
} from "@/api/staff/index.js";
import { reset } from "echarts/lib/visual/seriesColor";

export default {
  props: {
    formParams: {
      type: Object,
      default: null,
    },
  },
  data() {
    return {
      mabiao:'',
      openTableDialog: false,
      projectOptions: [],
      formParams: {
        enterpriseName: '',
        accordingContent: "",
        engineeringName: "",
        lwgs: "",
        commissionDate: '',
        businessType:'',
        businessManagerId:''

      },
    };
  },
  created() {
    this.getryList()
    this.getMabiao()
  },
  methods: {
      getMabiao(){
          getSystemset().then(res=>{
                this.mabiao = res.msg
          })
    },
    onchangeJC(val) {

    },
    getryList() {
      updatedtallList({ roleId: 4 }).then(res => {
        this.projectOptions = res.data
      }

      )
    },
    reset(){
      this.formParams = {
        businessType:'',
        businessManagerId:''
      }
        this.resetForm("queryForm");
    },

    onShouLi() {
      let obj = {
          id:this.formParams.id,
          businessType:this.formParams.businessType,
          businessManagerId:this.formParams.businessManagerId
      }
      acceptanceOrder(obj).then(res => {
        this.sendNotice(res);
        this.$message.success(`受理成功`)
        this.$emit('closeAcceptDialog')
        this.$emit('getList')
       // this.reset()

      })
    },

    sendNotice(data) {
    },



    onCheck() {
      this.openTableDialog = true
    },
    close() {
      this.$emit('closeAcceptDialog')
    }
  }
};
</script>

<style lang="scss" scoped>
.el-select {
  width: 300px;
}

.font-blod {
  font-weight: 600px;
}

.text-size {
  font-size: 14px;
  color: #606266;
}

.margin-bottom-10 {
  margin-bottom: 10px;
}
</style>
